#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"
#include <stdlib.h>
#include <math.h>

// Number of times the test runs variable
#define TRIALS 250

int main(){
        int i;
        int j;
    int value;
    int card;
    enum CARD begCard = curse;
    enum CARD endCard = treasure_map;
        struct gameState *state = malloc(sizeof(struct gameState));
    PlantSeeds(3);
        SelectStream(2);
        
    for(j = 0; j <= TRIALS; j++){
        for(i = 0; i < sizeof(struct gameState); i++){
            ((char*)state)[i] = floor(Random() * 256);
        }
        card = (Random() * (endCard - begCard)) + begCard;
        value = buyCard(card, state);
        assert(value == 0);
    }
    printf("Test finished");
    return 0;
}